<html>

<head>
	<link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/media/css/base.css">
	<link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/media/css/form.css">
</head>

<body>
	{% include "sysmodel/header.html" %}

	
	<div class="breadcrumbs">
		<a href="/objects/home/">Home</a> &gt; 
		Add {{flexyclass.name}}
	</div>
	
	<form enctype="multipart/form-data" action="/objects/add/{{flexyclass.id}}/" method="post">
		<div style="display:none">{% csrf_token %}</div>
		
		<span class="form-container"> 
			
			{% if usergroup_field|length > 0 %}
				<span class="form-heading">
					<h4>Add {{flexyclass.name}}</h4>
				</span>
				{% if rm %} <div class="errornote">{{ rm }}</div> {% endif %}
				<div class="form">

					{% for ugf in usergroup_field %}
						{% ifchanged ugf.field.group.id %}
							{% if forloop.counter0 %}</table></fieldset>{% endif %}
							<fieldset><legend>{{ugf.field.group.name}}</legend><table>
						{% endifchanged %}
						<tr>
							<td>
								<label>{{ugf.field.name}}</label>
							</td>
							<td>
								<input class="text" type="text" name="{{ugf.field.id}}"
									fieldtype="{{ugf.field.type}}" />
							</td>
						</tr>
					{% endfor %}
						</table></fieldset>
				</div>
			
				<span class="form-submit">
					<input class="submit" type="submit" value="Save"/>
					<input class="submit" type="reset" value="Reset"/>
				</span>
			{% endif %}
			
		</span>
	</form>
</body>

</html>
